﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MutationTestingTool.Model.Interfaces;

namespace MutationTestingTool.Model.Implementations
{
    public enum FactoryType
    {
        Xml
    }
    public class RepositoryFactory
    {
        private RepositoryFactory()
        {
            list = new Dictionary<FactoryType, IMutationRepository>();
            list.Add(FactoryType.Xml, new XmlRepository());
        }

        private IDictionary<FactoryType, IMutationRepository> list;

        private static RepositoryFactory repo;

        public static RepositoryFactory Current
        {
            get
            {
                if (repo == null)
                { repo = new RepositoryFactory(); }
                return repo;
            }
        }

        public IMutationRepository Repository(FactoryType type)
        {
            if (list.ContainsKey(type))
            {
                return list[type];
            }
            throw new NotImplementedException(type.ToString());
        }
    }
}
